package com.ruoyi.common.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.ruoyi.common.utils.EmptyAsNullDeserializer;
import io.swagger.v3.oas.annotations.media.Schema;

import java.io.Serializable;
import java.util.Date;

@Schema
public class SuperEntity implements Serializable {
    @TableId
    @JsonDeserialize(
            using = EmptyAsNullDeserializer.class
    )
    @Schema(
            description = "主键"
    )
    private String id;
    @TableField(
            fill = FieldFill.INSERT,
            updateStrategy = FieldStrategy.NEVER
    )
    @Schema(
            description = "创建时间"
    )
    private Date createDate;
    @TableField(
            fill = FieldFill.INSERT_UPDATE
    )
    @Schema(
            description = "更新时间"
    )
    private Date updateDate;
    @TableField(
            fill = FieldFill.INSERT
    )
    @Schema(
            description = "创建用户ID"
    )
    private String createBy;
    @TableField(
            fill = FieldFill.INSERT_UPDATE,
            insertStrategy = FieldStrategy.NEVER
    )
    @Schema(
            description = "更新用户ID"
    )
    private String updateBy;
    @TableLogic(
            delval = "1",
            value = "0"
    )
    @Schema(
            description = "删除标识(0：正常，1：删除)",
            hidden = true
    )
    private Integer delFlag = 0;

    public SuperEntity() {
    }

    public String getId() {
        return this.id;
    }

    public Date getCreateDate() {
        return this.createDate;
    }

    public Date getUpdateDate() {
        return this.updateDate;
    }

    public String getCreateBy() {
        return this.createBy;
    }

    public String getUpdateBy() {
        return this.updateBy;
    }

    public Integer getDelFlag() {
        return this.delFlag;
    }

    @JsonDeserialize(
            using = EmptyAsNullDeserializer.class
    )
    public void setId(String id) {
        this.id = id;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public void setUpdateDate(Date updateDate) {
        this.updateDate = updateDate;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public void setDelFlag(Integer delFlag) {
        this.delFlag = delFlag;
    }

    public boolean equals(Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof SuperEntity)) {
            return false;
        } else {
            SuperEntity other = (SuperEntity)o;
            if (!other.canEqual(this)) {
                return false;
            } else {
                Object this$delFlag = this.getDelFlag();
                Object other$delFlag = other.getDelFlag();
                if (this$delFlag == null) {
                    if (other$delFlag != null) {
                        return false;
                    }
                } else if (!this$delFlag.equals(other$delFlag)) {
                    return false;
                }

                Object this$id = this.getId();
                Object other$id = other.getId();
                if (this$id == null) {
                    if (other$id != null) {
                        return false;
                    }
                } else if (!this$id.equals(other$id)) {
                    return false;
                }

                Object this$createDate = this.getCreateDate();
                Object other$createDate = other.getCreateDate();
                if (this$createDate == null) {
                    if (other$createDate != null) {
                        return false;
                    }
                } else if (!this$createDate.equals(other$createDate)) {
                    return false;
                }

                Object this$updateDate = this.getUpdateDate();
                Object other$updateDate = other.getUpdateDate();
                if (this$updateDate == null) {
                    if (other$updateDate != null) {
                        return false;
                    }
                } else if (!this$updateDate.equals(other$updateDate)) {
                    return false;
                }

                Object this$createBy = this.getCreateBy();
                Object other$createBy = other.getCreateBy();
                if (this$createBy == null) {
                    if (other$createBy != null) {
                        return false;
                    }
                } else if (!this$createBy.equals(other$createBy)) {
                    return false;
                }

                Object this$updateBy = this.getUpdateBy();
                Object other$updateBy = other.getUpdateBy();
                if (this$updateBy == null) {
                    if (other$updateBy != null) {
                        return false;
                    }
                } else if (!this$updateBy.equals(other$updateBy)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(Object other) {
        return other instanceof SuperEntity;
    }

    public int hashCode() {
        int PRIME = 59;
        int result = 1;
        Object $delFlag = this.getDelFlag();
        result = result * 59 + ($delFlag == null ? 43 : $delFlag.hashCode());
        Object $id = this.getId();
        result = result * 59 + ($id == null ? 43 : $id.hashCode());
        Object $createDate = this.getCreateDate();
        result = result * 59 + ($createDate == null ? 43 : $createDate.hashCode());
        Object $updateDate = this.getUpdateDate();
        result = result * 59 + ($updateDate == null ? 43 : $updateDate.hashCode());
        Object $createBy = this.getCreateBy();
        result = result * 59 + ($createBy == null ? 43 : $createBy.hashCode());
        Object $updateBy = this.getUpdateBy();
        result = result * 59 + ($updateBy == null ? 43 : $updateBy.hashCode());
        return result;
    }

    public String toString() {
        return "SuperEntity(id=" + this.getId() + ", createDate=" + this.getCreateDate() + ", updateDate=" + this.getUpdateDate() + ", createBy=" + this.getCreateBy() + ", updateBy=" + this.getUpdateBy() + ", delFlag=" + this.getDelFlag() + ")";
    }
}
